package com.my.mycommondomain.exception;


import com.my.mycommondomain.domian.ResultCode;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

//@Getter
//@Setter
@Data
public class ServiceException extends RuntimeException {

    private String msg;
    private int code;

    public ServiceException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.code=resultCode.getCode();
        this.msg=resultCode.getMsg();
    }
    public ServiceException(String msg){
        super(msg);
        this.msg=msg;
        this.code=ResultCode.ERROR.getCode();
    }
    public ServiceException(String msg,int code){
        super(msg);
        this.msg=msg;
        this.code=code;
    }
}
